/*
 * Copyright (c) 2019-2020, https://api.iot.10086.cn/(https://gitee.com/cmcc-iot-api/iot-card-open-application/).
 */
package cn.iot.card.open.sim.warpper;

import cn.iot.card.open.constants.Constants;
import cn.iot.card.open.constants.factory.ConstantFactory;
import cn.stylefeng.roses.core.base.warpper.BaseControllerWrapper;
import cn.stylefeng.roses.kernel.model.page.PageResult;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.Map;

/**
 * 物联卡业务办理结果包装类
 *
 * @author zhanlele
 * @date 20200324 11:45:18
 * @modify 20200324 zhanlele v1.1.2 创建
 * @since v1.1.2
 */
public class BusinessHandleResultWrapper extends BaseControllerWrapper {

    public BusinessHandleResultWrapper(Map<String, Object> single) {
        super(single);
    }

    public BusinessHandleResultWrapper(List<Map<String, Object>> multi) {
        super(multi);
    }

    public BusinessHandleResultWrapper(Page<Map<String, Object>> page) {
        super(page);
    }

    public BusinessHandleResultWrapper(PageResult<Map<String, Object>> pageResult) {
        super(pageResult);
    }

    @Override
    protected void wrapTheMap(Map<String, Object> map) {
        map.put(Constants.JOB_STATUS, ConstantFactory.me().getBusinessResultType((String) map.get(Constants.JOB_STATUS)));
        if (null != map.get(Constants.RESPONSE_RESULT_TYPE)) {
            map.put(Constants.RESPONSE_RESULT_TYPE, ConstantFactory.me().getBusinessCardType((String) map.get(Constants.RESPONSE_RESULT_TYPE)));
        }
    }
}
